﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="RecordReaderContracts.cs" company="Rolosoft Ltd">
//   © Rolosoft Ltd
// </copyright>
// --------------------------------------------------------------------------------------------------------------------

#region License

// Copyright 2013 Rolosoft Ltd
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// http://www.apache.org/licenses/LICENSE-2.0
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
#endregion

namespace Rsft.Net.Dns.Interfaces
{
    #region Usings

    using System.Diagnostics.Contracts;

    using Rsft.Net.Dns.Entities;

    #endregion

    /// <summary>
    ///     The record reader contracts.
    /// </summary>
    [ContractClassFor(typeof(IRecordReader))]
    internal abstract class RecordReaderContracts : IRecordReader
    {
        #region Public Properties

        /// <summary>
        ///     Gets or sets the position.
        /// </summary>
        public virtual int Position { get; set; }

        #endregion

        #region Public Methods and Operators

        /// <summary>
        ///     The read byte.
        /// </summary>
        /// <returns>
        ///     The <see cref="byte" />.
        /// </returns>
        public virtual byte ReadByte()
        {
            return default(byte);
        }

        /// <summary>
        /// The read bytes.
        /// </summary>
        /// <param name="length">
        /// The length.
        /// </param>
        /// <returns>
        /// The <see cref="byte[]"/>.
        /// </returns>
        public virtual byte[] ReadBytes(int length)
        {
            Contract.Requires(length >= 0);

            return default(byte[]);
        }

        /// <summary>
        ///     The read domain name.
        /// </summary>
        /// <returns>
        ///     The <see cref="string" />.
        /// </returns>
        public virtual string ReadDomainName()
        {
            return default(string);
        }

        /// <summary>
        /// The read record.
        /// </summary>
        /// <param name="dnsType">
        /// The dns type.
        /// </param>
        /// <returns>
        /// The <see cref="Record"/>.
        /// </returns>
        public virtual Record ReadRecord(RecordType dnsType)
        {
            return default(Record);
        }

        /// <summary>
        ///     The read string.
        /// </summary>
        /// <returns>
        ///     The <see cref="string" />.
        /// </returns>
        public virtual string ReadString()
        {
            return default(string);
        }

        /// <summary>
        ///     The read u int 16.
        /// </summary>
        /// <returns>
        ///     The <see cref="ushort" />.
        /// </returns>
        public virtual ushort ReadUInt16()
        {
            return default(ushort);
        }

        /// <summary>
        /// The read u int 16.
        /// </summary>
        /// <param name="offset">
        /// The offset.
        /// </param>
        /// <returns>
        /// The <see cref="ushort"/>.
        /// </returns>
        public virtual ushort ReadUInt16(int offset)
        {
            return default(ushort);
        }

        /// <summary>
        ///     The read u int 32.
        /// </summary>
        /// <returns>
        ///     The <see cref="uint" />.
        /// </returns>
        public virtual uint ReadUInt32()
        {
            return default(uint);
        }

        #endregion
    }
}